Optimal. Leaf size=100 \[ -\frac {a (A+B) \cos (e+f x) \log (1-\sin (e+f x))}{f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}+\frac {a B \cos (e+f x) \sqrt {c-c \sin (e+f x)}}{c f \sqrt {a+a \sin (e+f x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 100, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 40, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.125, Rules used = {3050, 2817,
2816, 2746, 31} \begin {gather*} \frac {a B \cos (e+f x) \sqrt {c-c \sin (e+f x)}}{c f \sqrt {a \sin (e+f x)+a}}-\frac {a (A+B) \cos (e+f x) \log (1-\sin (e+f x))}{f \sqrt {a \sin (e+f x)+a} \sqrt {c-c \sin (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 31
Rule 2746
Rule 2816
Rule 2817
Rule 3050
Rubi steps
\begin {align*} \int \frac {\sqrt {a+a \sin (e+f x)} (A+B \sin (e+f x))}{\sqrt {c-c \sin (e+f x)}} \, dx &=(A+B) \int \frac {\sqrt {a+a \sin (e+f x)}}{\sqrt {c-c \sin (e+f x)}} \, dx-\frac {B \int \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)} \, dx}{c}\\ &=\frac {a B \cos (e+f x) \sqrt {c-c \sin (e+f x)}}{c f \sqrt {a+a \sin (e+f x)}}+\frac {(a (A+B) c \cos (e+f x)) \int \frac {\cos (e+f x)}{c-c \sin (e+f x)} \, dx}{\sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}\\ &=\frac {a B \cos (e+f x) \sqrt {c-c \sin (e+f x)}}{c f \sqrt {a+a \sin (e+f x)}}-\frac {(a (A+B) \cos (e+f x)) \text {Subst}\left (\int \frac {1}{c+x} \, dx,x,-c \sin (e+f x)\right )}{f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}\\ &=-\frac {a (A+B) \cos (e+f x) \log (1-\sin (e+f x))}{f \sqrt {a+a \sin (e+f x)} \sqrt {c-c \sin (e+f x)}}+\frac {a B \cos (e+f x) \sqrt {c-c \sin (e+f x)}}{c f \sqrt {a+a \sin (e+f x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains complex when optimal does not.
time = 0.81, size = 125, normalized size = 1.25 \begin {gather*} -\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sqrt {a (1+\sin (e+f x))} \left (-\left ((A+B) \left (\log \left (e^{i (e+f x)}\right )-2 \log \left (-i+e^{i (e+f x)}\right )\right )\right )+B \sin (e+f x)\right )}{f \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \sqrt {c-c \sin (e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(393\) vs.
\(2(92)=184\).
time = 0.34, size = 394, normalized size = 3.94
method | result | size |
default | \(-\frac {\left (A \cos \left (f x +e \right ) \ln \left (\frac {2}{1+\cos \left (f x +e \right )}\right )+A \ln \left (\frac {2}{1+\cos \left (f x +e \right )}\right ) \sin \left (f x +e \right )-2 A \cos \left (f x +e \right ) \ln \left (-\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}\right )-2 A \sin \left (f x +e \right ) \ln \left (-\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}\right )+B \cos \left (f x +e \right ) \ln \left (\frac {2}{1+\cos \left (f x +e \right )}\right )+B \ln \left (\frac {2}{1+\cos \left (f x +e \right )}\right ) \sin \left (f x +e \right )+B \left (\cos ^{2}\left (f x +e \right )\right )-B \sin \left (f x +e \right ) \cos \left (f x +e \right )-2 B \cos \left (f x +e \right ) \ln \left (-\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}\right )-2 B \sin \left (f x +e \right ) \ln \left (-\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}\right )-A \ln \left (\frac {2}{1+\cos \left (f x +e \right )}\right )+2 A \ln \left (-\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}\right )-B \ln \left (\frac {2}{1+\cos \left (f x +e \right )}\right )+B \sin \left (f x +e \right )+2 B \ln \left (-\frac {-1+\cos \left (f x +e \right )+\sin \left (f x +e \right )}{\sin \left (f x +e \right )}\right )-B \right ) \sqrt {a \left (1+\sin \left (f x +e \right )\right )}}{f \left (-1+\cos \left (f x +e \right )-\sin \left (f x +e \right )\right ) \sqrt {-c \left (\sin \left (f x +e \right )-1\right )}}\) | \(394\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 187, normalized size = 1.87 \begin {gather*} \frac {B {\left (\frac {2 \, \sqrt {a} \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{\sqrt {c}} - \frac {\sqrt {a} \log \left (\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )}{\sqrt {c}} + \frac {2 \, \sqrt {a} \sqrt {c} \sin \left (f x + e\right )}{{\left (c + \frac {c \sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (f x + e\right ) + 1\right )}}\right )} + A {\left (\frac {2 \, \sqrt {a} \log \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - 1\right )}{\sqrt {c}} - \frac {\sqrt {a} \log \left (\frac {\sin \left (f x + e\right )^{2}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{2}} + 1\right )}{\sqrt {c}}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )} \left (A + B \sin {\left (e + f x \right )}\right )}{\sqrt {- c \left (\sin {\left (e + f x \right )} - 1\right )}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 148, normalized size = 1.48 \begin {gather*} \frac {\sqrt {2} {\left (\frac {2 \, \sqrt {2} B \cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}{\sqrt {c} \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} + \frac {\sqrt {2} {\left (A \sqrt {c} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right ) + B \sqrt {c} \mathrm {sgn}\left (\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )\right )} \log \left (-2 \, \cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 2\right )}{c \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}\right )} \sqrt {a}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (A+B\,\sin \left (e+f\,x\right )\right )\,\sqrt {a+a\,\sin \left (e+f\,x\right )}}{\sqrt {c-c\,\sin \left (e+f\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________